package com.lmk.feign;

import com.lmk.domain.Product;
import com.lmk.query.ProductQuery;
import com.lmk.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ProductServiceFallbackFactory implements FallbackFactory<ProductService> {
    @Override
    public ProductService create(Throwable throwable) {
        return new ProductService() {
            @Override
            public JSONResult saveOrUpdate(Product product) {
                return null;
            }

            @Override
            public JSONResult delete(Long id) {
                return null;
            }

            @Override
            public JSONResult get(Long id) {
                return null;
            }

            @Override
            public JSONResult list() {
                return null;
            }

            @Override
            public JSONResult page(ProductQuery query) {
                return null;
            }

            @Override
            public Product getbyname(String productname) {
                return null;
            }
        };
    }
}
